<template>
  <div class="product-container">
    <!-- 左侧卡片列 -->
    <div class="product-column">
      <div
        class="pro"
        v-for="(item,index) in buyDataLeft"
        :key="index"
      >
        <div class="content-wrapper">
          <div class="text-content">
            <h2>{{ item.title }}</h2>
            <p>{{ item.desc }}</p>
          </div>
          <div class="image-container">
            <img :src="item.image" alt="产品图片" class="product-image">
          </div>
        </div>
      </div>
    </div>
    
    <!-- 右侧卡片列 -->
    <div class="product-column">
      <div
        class="pro"
        v-for="(item,index) in buyDataRight"
        :key="index"
      >
        <div class="content-wrapper">
          <div class="text-content">
            <h2>{{ item.title }}</h2>
            <p>{{ item.desc }}</p>
          </div>
          <div class="image-container">
            <img :src="item.image" alt="产品图片" class="product-image">
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      
      buyDataLeft: [
        {
          title: "产品介绍",
          desc: "产品生产源头，特点描述",
          image: require('../assets/images/slide5.jpg')
        },
        {
          title: "品牌定位",
          desc: "品牌定位可以帮助你更好的选择侧重点",
          image: require('../assets/images/slide6.jpg')
        }
      ],
      
      buyDataRight: [
        {
          title: "品牌价位",
          desc: "根据用户不同的价位介绍不同产品",
          image: require('../assets/images/slide7.jpg')
        },
        {
          title: "产品创新",
          desc: "根据客户的不同需求研发产品",
          image: require('../assets/images/slide8.jpg')
        }
      ]
    }
  }
}
</script>

<style scoped>
.product-container {
  display: flex;
  margin-left: 245px;
  gap:10px; /* 两列之间的间距 */
  padding: 20px;
}

.product-column {
  display: flex;
  flex-direction: column;
  gap: 20px; /* 卡片之间的垂直间距 */
  width: 45%; /* 每列占据一半宽度 */
}

.pro {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 30px;
  transition: all 0.3s ease;
  display: flex;
}

.content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.text-content {
  flex: 1;
  padding-right: 20px;
}

.image-container {
  width: 90px;
  height: 120px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pro:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.pro:hover .product-image {
  transform: scale(1.05);
}

.pro h2 {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
}

.pro p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

@media (max-width: 1200px) {
  .product-container {
    margin-left: 10px;
  }
}

@media (max-width: 992px) {
  .product-container {
    flex-direction: column;
    margin-left: 50px;
    gap: 20px;
  }
  
  .product-column {
    width: 100%;
  }
  
  .content-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .image-container {
    margin-top: 15px;
    width: 100%;
    height: 150px;
  }
  
  .text-content {
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  .product-container {
    margin-left: 0;
    padding: 10px;
  }
}
</style>
